<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>美食探索</title>
    {% load static %}
    <style>
        /* 同步主站背景 */
        body {
            background-image: url("{% static 'images/背景x.jpg' %}");
            background-size: cover;
            background-position: center;
            background-attachment: fixed;
            min-height: 100vh;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            margin: 0;
            padding: 0;
            color: #333;
        }

        /* 主标题样式统一 */
        h1 {
            font-size: 3.2rem;
            margin: 2rem 0;
            background: linear-gradient(to right, #b12f6e, #efacd1);
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
            position: relative;
            padding-bottom: 1.5rem;
            text-shadow: none;
        }

        h1::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 150px;
            height: 4px;
            background: linear-gradient(90deg, #b12f6e, #efacd1);
            border-radius: 2px;
        }

        /* 容器样式增强 */
        .container {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            min-height: 80vh;
            padding: 3rem 2rem;
            backdrop-filter: blur(8px);
            background: rgba(255, 255, 255, 0.8);
            border-radius: 20px;
            margin: 5% auto;
            box-shadow: 0 12px 40px rgba(177, 47, 110, 0.15);
            border: 1px solid rgba(239, 172, 209, 0.3);
            max-width: 600px;
        }

        /* 表单样式重构 */
        form {
            width: 100%;
            max-width: 400px;
            text-align: center;
            background: rgba(255, 255, 255, 0.85);
            border-radius: 15px;
            padding: 2rem;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
            border: 2px solid #efacd1;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        form:hover {
            transform: translateY(-5px);
            box-shadow: 0 12px 40px rgba(177, 47, 110, 0.2);
        }

        /* 下拉菜单样式增强 */
        label {
            font-size: 1.6rem;
            color: #8a2054;
            font-weight: 500;
            display: block;
            margin-bottom: 2rem;
        }

        select {
            font-size: 1.2rem;
            padding: 1.2rem;
            width: 100%;
            margin-bottom: 2rem;
            border: 2px solid #efacd1;
            border-radius: 12px;
            transition: all 0.3s ease;
            background: rgba(255, 255, 255, 0.9);
        }

        select:focus {
            border-color: #b12f6e;
            box-shadow: 0 0 15px rgba(177, 47, 110, 0.2);
        }

        /* 按钮样式调整 */
        button {
            width: 100%;
            padding: 1.2rem;
            font-size: 1.3rem;
            margin-top: 1.5rem;
            border-radius: 30px;
            background: linear-gradient(135deg, #b12f6e, #efacd1);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        button:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 20px rgba(177, 47, 110, 0.3);
        }

        /* 登录链接样式增强 */
        a {
            font-size: 1.2rem;
            padding: 1rem 2rem;
            margin-top: 2rem;
            border: 2px solid #b12f6e;
            background: rgba(255, 255, 255, 0.9);
        }

        /* 响应式调整 */
        @media (max-width: 768px) {
            .container {
                width: 90%;
                padding: 2rem 1rem;
            }
            
            h1 {
                font-size: 2.5rem;
            }

            label {
                font-size: 1.6rem;
            }

            select {
                font-size: 1.2rem;
                padding: 1.2rem;
            }

            button {
                font-size: 1.3rem;
            }

            a {
                font-size: 1.2rem;
            }
        }
    </style>
</head>
<body>

    <div class="container">
        <h1>美食分类</h1>

        <!-- 修改后的表单结构 -->
        <form id="categoryForm">
            <label for="category">选择分类</label>
            <select name="category_id" id="category">
                {% for category in categories %}
                    <option value="{{ category.id }}">{{ category.name }}</option>
                {% endfor %}
            </select>
            <button type="submit">查看详情</button>
        </form>

        <!-- 调整后的登录链接 -->
        <a href="{% url 'login' %}" class="login-btn">用户登录</a>
    </div>

    <script>
    document.getElementById('categoryForm').addEventListener('submit', function(e) {
        e.preventDefault();
        const categoryId = document.getElementById('category').value;
        window.location.href = `/category/${categoryId}/`;
    });
    </script>

</body>
</html>
